浏览量 4324
2019/03/05 17:09
1.vue-echart 点击跳转通过路由传参。
<template>
<div :style="{height: height + 'px'}">
<IEcharts :option="line_option" :loading="loading" @ready="onReady" @click="onClick"></IEcharts>
</div>
</template>
methods: {
onClick(event, instance, ECharts) {
let date = new Date(event.name.slice(0, 4) + '/' + event.name.slice(4, 6) + '/' + event.name.slice(6, 8))
let starttime = date
let endtime = new Date(date.getTime() + 24 * 60 * 60 * 1000)
this.$router.push({
path: "Detail",
name: "告警详情",
params: {
timevalue: [starttime, endtime]
}
})
}
}
2.跳转页面参数接收:
created: function () {
if (this.$route.params.timevalue) {
this.timevalue = this.$route.params.timevalue
console.log(this.timevalue)
}
}
上一篇 搜索 下一篇